package com.vm.osm.business.dto.eam.equ;

import com.google.common.base.MoreObjects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
@ApiModel("EamEqu")
public class EamEqu implements Serializable {
    @ApiModelProperty("设备归属（1：仓库、2：设备、3：部门、4：人员）")
    private Byte belong_type;
    @ApiModelProperty(value = "设备属性集合", dataType = "EamEqu.CommonAttr")
    private List<CommonAttr> common_attr_list;
    @ApiModelProperty("所属部门编号")
    private String department_id;
    @ApiModelProperty("所属部门名称")
    private String department_name;
    @ApiModelProperty(value = "自定义字段列表", dataType = "EamEqu.DiyAttr")
    private List<DiyAttr> diy_field_list;
    @ApiModelProperty("设备编号")
    private String equ_code;
    @ApiModelProperty(value = "配件列表", dataType = "EamEqu.EquPart")
    private List<EquPart> equ_part_list;
    @ApiModelProperty("设备类型编号")
    private String equ_type_id;
    @ApiModelProperty("设备类型名称")
    private String equ_type_name;
    @ApiModelProperty("系统编号")
    private String id;
    @ApiModelProperty("行业编号")
    private String industry_id;
    @ApiModelProperty("行业类型（1：通用、2：专业）")
    private Byte industry_type;
    @ApiModelProperty("所属员工编号")
    private String staff_id;
    @ApiModelProperty("所属员工名称")
    private String staff_name;
    @ApiModelProperty("设备状态（1：闲置、2：在用、3：借用、4：报废、5：丢失、6：维护锁定、7：故障锁定）")
    private Byte status;
    @ApiModelProperty("所属仓库编号")
    private String ware_house_id;
    @ApiModelProperty("所属仓库")
    private String ware_house_name;

    @Data
    @ApiModel("EamEqu.EquPart")
    public static class EquPart implements Serializable {
        @ApiModelProperty("品牌")
        private String brand;
        @ApiModelProperty("配件编码")
        private String equ_part_code;
        @ApiModelProperty("配件类型")
        private String equ_part_type_name;
        @ApiModelProperty("系统编号")
        private String id;
        @ApiModelProperty("型号")
        private String model;
        @ApiModelProperty("规格")
        private String spec;
        @ApiModelProperty("库存总数")
        private Integer stock_num;
        @ApiModelProperty("数量")
        private Integer total_num;

        @Override
        public String toString() {
            return MoreObjects.toStringHelper(this)
                    .add("brand", brand)
                    .add("equ_part_code", equ_part_code)
                    .add("equ_part_type_name", equ_part_type_name)
                    .add("id", id)
                    .add("model", model)
                    .add("spec", spec)
                    .add("stock_num", stock_num)
                    .add("total_num", total_num)
                    .toString();
        }
    }

    @Data
    @ApiModel("EamEqu.DiyAttr")
    public static class DiyAttr implements Serializable {
        @ApiModelProperty("字段Id")
        private String id;
        @ApiModelProperty("字段标题")
        private String field_title;
        @ApiModelProperty("字段value")
        private String field_value;

        @Override
        public String toString() {
            return MoreObjects.toStringHelper(this)
                    .add("id", id)
                    .add("field_title", field_title)
                    .add("field_value", field_value)
                    .toString();
        }
    }


    @Data
    @ApiModel("EamEqu.CommonAttr")
    public static class CommonAttr implements Serializable {
        @ApiModelProperty("字段key")
        private String field_key;
        @ApiModelProperty("字段value")
        private String field_value;

        @Override
        public String toString() {
            return MoreObjects.toStringHelper(this)
                    .add("field_key", field_key)
                    .add("field_value", field_value)
                    .toString();
        }
    }
}
